import {defineStore} from "pinia";
import {ref} from "vue";

const tabbarKey = "tabbarExpandKey"
let useTabbarStore
    = defineStore("tabbarStore", () => {

    let expandFlag = ref(getExpandFlag())
    let refresh=ref(true);

    function getExpandFlag() {
        let expandFlagStr = localStorage.getItem(tabbarKey);
        return expandFlagStr === "true";
    }

    function setExpandFlag(value) {
        expandFlag.value = value;
        localStorage.setItem(tabbarKey, value);
    }

    return {
        expandFlag,
        setExpandFlag,
        refresh,
    }
})

export default useTabbarStore;